home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / INTERRUP.SWG / 0011_Handling Ctrl-Break.pas < prev    next >
Pascal/Delphi Source File  |  1993-08-27  |  1KB  |  55 lines

  1. {
  2. BRYCE OSTENSON
  3.  
  4. > I am looking for a way to diable the use of the control break and control
  5. > alt delete features.
  6.  
  7. BTW: Simple concept...  Here's how it works - When the program begins,
  8. SavedInt23 is assigned to the original C-Break interrupt...  When the
  9. SetCtrlBreak procedure is called with Status equaling false, the C-Break
  10. interrupt is assigned to a CBreakHandler which has no substance...  Thus
  11. when C-Break is called it does nothing.  When SetCtrlBreak is called
  12. with Status equaling false, Interrupt 23h is assigned to the default
  13. C-Break handler.
  14. }
  15.  
  16. UNIT TBUtil;
  17.  
  18. INTERFACE
  19.  
  20. Uses
  21.   Dos;
  22.  
  23. Var
  24.   SavedInt23 : Pointer;
  25.   CBreak     : Boolean;
  26.  
  27. Procedure SetCtrlBreak(Status : Boolean);
  28. Function  GetCtrlBreak : Boolean;
  29.  
  30. IMPLEMENTATION
  31.  
  32. Procedure CBreakHandler; INTERRUPT;
  33. Begin
  34. End;
  35.  
  36. Procedure SetCtrlBreak(Status : Boolean);
  37. Begin
  38.   If Status then
  39.     SetIntVec($23, SavedInt23);
  40.   Else
  41.     SetIntVec($23, @CBreakHandler);
  42.   CBreak := Status;
  43. End;
  44.  
  45. Function GetCtrlBreak : Boolean;
  46. Begin
  47.   GetCtrlBreak := CBreak;
  48. End;
  49.  
  50. Begin
  51.   CBreak := True;
  52.   GetIntVec($23, SavedInt23); { Save the Ctrl-Break handler. }
  53. End.
  54.  
  55.